<?php
namespace app\api\controller;
use think\facade\Db;
use think\facade\Request;
use ouyangke\Ticket;

class User{
    // Access to XMLHttpRequest at 'http://www.tp.com/index.php/api/Api/index' 
    // from origin 'http://localhost:8080' has been blocked by CORS policy: No 
    // 'Access-Control-Allow-Origin' header is present on the requested resource.
    // 错误信息：是因为前后端分离导致的。前后端 前端和后端的域名不是一个。不是一个，就会出现这种错误。
    // 跨域名访问的安全错误提示
    
    public function __construct(){
        // 使用php的header函数，设置为*，全部能访问
        header("Access-Control-Allow-Origin:*");

        $token = input('post.token');
        
    }
}